<?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
   xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
   xmlns:f="http://xmlns.jcp.org/jsf/core"
   xmlns:h="http://xmlns.jcp.org/jsf/html"
   xmlns:p="http://primefaces.org/ui"   
   xmlns:c="http://xmlns.jcp.org/jsp/jstl/core"
   template="/WEB-INF/templates/default.xhtml">
   
   	<f:metadata>	   	
	   	<f:viewParam name="firstResult" value="#{serviceSupplierManageList.firstResult}"></f:viewParam>	
	   	<f:viewParam name="moduleName" value="中介实体入驻情况"></f:viewParam>
	   	<f:viewParam name="supplierName" value="#{serviceSupplierManageList.cnname}"></f:viewParam>
	   	<f:viewParam name="minScore" value="#{serviceSupplierManageList.minScore}"></f:viewParam>
	   	<f:viewParam name="maxScore" value="#{serviceSupplierManageList.maxScore}"></f:viewParam>
   		<f:viewParam name="auditStatus" value="#{serviceSupplierManageList.parameterValues['auditStatus']}"></f:viewParam>
   		<f:viewParam name="qClassName" value="#{serviceSupplierList.parameterValues['qClassName']}"></f:viewParam>
		<f:viewParam name="qClassId" value="#{qualificationConditionBean.qualificationClassId}"></f:viewParam>
		<f:viewParam name="agentServiceId" value="#{qualificationConditionBean.agentServiceId}"></f:viewParam>
		<f:viewParam name="sectorId" value="#{qualificationConditionBean.sectorId}"></f:viewParam>
		<f:viewParam name="childSectorSno" value="#{qualificationConditionBean.childSectorSno}"></f:viewParam>
		<f:viewParam name="certLevel" value="#{qualificationConditionBean.certLevel}"></f:viewParam>
   	</f:metadata>
   
   	<ui:define name="content">
   
		<h:form id="searchForm">
			<div style="height:50px;margin-left:10px">				
				<p:outputLabel value="中介名称："></p:outputLabel>				
				<p:inputText value="#{serviceSupplierManageList.cnname}"></p:inputText>
				<p:outputLabel value="信用分："></p:outputLabel>
				<p:inputNumber value="#{serviceSupplierManageList.minScore}"></p:inputNumber>
				-
				<p:inputNumber value="#{serviceSupplierManageList.maxScore}"></p:inputNumber>
				<p:outputLabel value="服务事项："></p:outputLabel>
					<p:selectOneMenu value="#{qualificationConditionBean.agentServiceId}" filter="true">
						<f:selectItem
									itemLabel="--请选择--"
									itemValue="#{null}"
								/>
								<f:selectItems
									value="#{agentServiceList.resultList}"
									var="_agentService"
									itemLabel="#{_agentService.name}"
									itemValue="#{_agentService.id}"
								></f:selectItems>
					</p:selectOneMenu>	
					
					<p:outputLabel value="资质范围："></p:outputLabel>
					<p:outputPanel>
						<p:selectOneMenu
							value="#{qualificationConditionBean.qualificationClassId}"
						>
							<f:selectItem
								itemLabel="--请选择--"
								itemValue="#{null}"
							/>
							<f:selectItems
								value="#{qualificationClassList.resultList}"
								var="_class"
								itemLabel="#{_class.name}"
								itemValue="#{_class.id}"
							>
							</f:selectItems>
							<f:ajax render="sectorId certLevel"></f:ajax>
						</p:selectOneMenu>#{' '}	
										
						<p:selectOneMenu
							id="sectorId"
							widgetVar="sectorId"
							value="#{qualificationConditionBean.sectorId}"
						>
							<f:selectItem
								itemLabel="--请选择--"
								itemValue="#{null}"
							/>
							<f:selectItems
								value="#{qualificationConditionBean.sectors}"
								var="_sector"
								itemLabel="#{_sector.sectorName}"
								itemValue="#{_sector.id}"
							></f:selectItems>
							<f:ajax event="change" listener="#{qualificationConditionBean.initChildSectors()}" render="childSectorId"></f:ajax>
						</p:selectOneMenu>
						
						<p:selectOneMenu
							id="childSectorId"
							widgetVar="childSectorId"
							value="#{qualificationConditionBean.childSectorSno}"
						>
							<f:selectItem
								itemLabel="--请选择--"
								itemValue="#{null}"
							/>
							<f:selectItems
								value="#{qualificationConditionBean.childSectors}"
								var="_childsector"
								itemLabel="#{_childsector.sectorName}"
								itemValue="#{_childsector.sno}"
							></f:selectItems>
							
						</p:selectOneMenu>

					</p:outputPanel>
					<p:outputLabel value="资质等级："></p:outputLabel>
					<p:selectOneMenu
						id="certLevel"
						value="#{qualificationConditionBean.certLevel}"
					>
					<f:selectItem
						itemLabel="--请选择--"
						itemValue="#{null}"
					/>
					
					<f:selectItems
						value="#{qualificationConditionBean.qualificationLevels}"
						var="_level"
						itemLabel="#{_level.name}"
						itemValue="#{_level.value}"
					></f:selectItems>						
				</p:selectOneMenu>
				<p:outputLabel value="审核状态："></p:outputLabel>				
				<p:selectOneMenu style="position: relative;top: 0px;" value="#{serviceSupplierManageList.parameterValues['auditStatus']}">
								<f:selectItem itemLabel="请选择" itemValue="#{null}"  />
								<f:selectItem itemLabel="未审核" itemValue="#{2}" />
								<f:selectItem itemLabel="审核成功" itemValue="#{1}" />
								<f:selectItem itemLabel="审核失败" itemValue="#{0}" />
				</p:selectOneMenu>
				
				<div class="actionButtons">
					<p:commandButton value="查询" ajax="false"   action="ServiceSupplierStatList.xhtml?faces-redirect=true&amp;includeViewParams=true&amp;firstResult=0" styleClass="blue-int"></p:commandButton>
					<p:button value="重置" outcome="ServiceSupplierStatList.xhtml"></p:button>
				</div>		
				<div class="clearbt"></div>
			</div>
			
			<p:panel id="searchResult">
				<f:facet name="header">中介实体入驻情况</f:facet>
				<p:dataTable value="#{serviceSupplierManageList.resultList}" var="_serviceSupplier">
					
					<p:column>
						<f:facet name="header">名称</f:facet>
						#{_serviceSupplier.cnname}
					</p:column>
					
					<p:column >
						<f:facet name="header">工作地址</f:facet>
						#{_serviceSupplier.address}
					</p:column>
					
				</p:dataTable>
			</p:panel>
			
			<ui:include src="/WEB-INF/templates/manage/pagination.xhtml">
				<ui:param name="entityList" value="#{serviceSupplierManageList}" />
			</ui:include>
			
		</h:form>
      
   	</ui:define>
</ui:composition>
